<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="button" value="浪起来" @click="lang">
    <input type="button" value="低调" @click="stop">
    <p>{{msg}}</p>
</div>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            msg:'猥琐发育，别浪--',
            intervalID:null
        },
        methods:{
            lang(){
                // console.log(this.msg)
                if (this.intervalID!=null)return;
                this.intervalID=setInterval( () => {
                    var start=this.msg.substring(0,1);
                    var end=this.msg.substring(1);
                    end=end+start;
                    this.msg=end
                },400)

            },
            stop(){
                clearInterval(this.intervalID);
                this.intervalID=null
            }
        }

    })
</script>
</body>
</html>